import { createApp } from 'vue'
// import { registerApp } from '@/global' 按需引用

// import hjmRequest from '@/service'
import App from './App.vue'

import 'normalize.css'
import './assets/css/index.less'

import router from '@/router'
import store from '@/store'
import ElementPlus from 'element-plus' //全局引用
import 'element-plus/dist/index.css'
import * as Icons from '@element-plus/icons'

//app是有类型的  App类型
const app = createApp(App)

app.use(router)
app.use(store)
// registerApp(app)
app.use(ElementPlus)
app.mount('#app')

// console.log(process.env.VUE_APP_BASE_URL)
// console.log(process.env.VUE_APP_BASE_NAME)

Object.keys(Icons).forEach((key) => {
  app.component(key, (Icons as any)[key])
})

/*
interface DataType {
  data: any
  returnCode: string
  success: boolean
}
hjmRequest
  .get<DataType>({
    url: '/home/multidata',
    interceptors: {
      requestInterceptor: (config) => {
        console.log('单独请求的config')
        return config
      },
      responseInterceptor: (res) => {
        console.log('单独响应的response')
        return res
      }
    },
    showLoading: false
  })
  .then((res) => {
    console.log(res.data)
    console.log(res.returnCode)
    console.log(res.success)
  })
*/
